#include <bits/stdc++.h>
using namespace std;
const int N = 110;
const int M = 1010;
const int INF = 0x3f3f3f3f;

int a[N], f[M];

int main() {
  int n, k;
  while (cin >> n >> k) {
    if (n == 0 || k == 0)
      break;
    memset(f, 0x3f, sizeof f);
    f[0] = 0;
    for (int i = 1; i <= n; i++)
      cin >> a[i];
    for (int i = 1; i <= n; i++)
      for (int j = a[i]; j <= k; j++)
        f[j] = min(f[j], f[j - a[i]] + 1);
    if (f[k] == INF)
      cout << -1 << endl;
    else
      cout << f[k] << endl;
  }
  return 0;
}
